﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>年度任务完成表</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
</head>
<body>
    <div class="layui-tab layui-tab-brief main-tab-container">
        <div class="col-sm-4 ct-padding">
            <div class="pull-right mail-search">
                <div class="input-group">
                    <input id="inputStr" type="text" class="form-control" placeholder="请输入年度(格式如：2017)">
                    <span class="input-group-btn" style="padding-left:10px">
                        <button id="btnSearch" class="layui-btn  layui-btn-normal layui-btn-small"><span class="glyphicon glyphicon-search"></span>查询 </button>
                        <button id="btnExport" class="layui-btn layui-btn-springgreen layui-btn-small"><span class="glyphicon glyphicon-share"></span> 导出 </button>
                    </span>
                </div>
            </div>
        </div>  
                 
        <div class="col-sm-12  layui-tab-content">
            <div class="mail-box" style="overflow-x:scroll;white-space:nowrap;">
                <table class="layui-table" lay-skin="line">
                    <thead>
                        <tr>
                            <th hidden></th>
                            <th>单位名称</th>
                            <th>住宅数</th>
                            <th>住宅任务数</th>
                            <th>住宅完成比(%)</th>
                            <th>非住宅数</th>
                            <th>非住宅任务数</th>
                            <th>非住宅完成比(%)</th>
                            <th>受理数</th>
                            <th>受理任务数</th>
                            <th>受理完成比(%)</th>
                            <th>已纳税额(元)</th>
                            <th>纳税任务数</th>
                            <th>纳税完成比(%)</th>
                        </tr>
                    </thead>
                    <tbody id="accordion"></tbody>
                </table>
            </div>
        </div>  
    </div>



    <!-- 导出模态 -->
    <form action="/ReportForms/GIS_AnnualTaskMeg" enctype="multipart/form-data" method="post" id="formDownload">
        <div id="exportHtml" style="display:none;">
            <div class="eh_wrap">
                <div class="eh_head">
                    <p style="">请选择您要导出的数据列</p>
                </div>
                <table width="100%" cellpadding="5" cellspacing="0">
                    <tr>
                        <td><input id="StreetOffice" type="checkbox" value="单位名称" name="chk_list" checked="checked" /><label>单位名称</label></td>
                    </tr>
                    <tr>
                        <td><input id="StreetOfficeHousNumber" type="checkbox" value="住宅数" name="chk_list" checked="checked" /><label>住宅数</label></td>
                        <td><input id="HousNumAT" type="checkbox" value="住宅任务数" name="chk_list" checked="checked" /><label>住宅任务数</label></td>
                        <td><input id="HNBfb" type="checkbox" value="住宅完成比(%)" name="chk_list" checked="checked" /><label>住宅完成比(%)</label></td> 
                    </tr>
                    <tr>
                       
                        <td><input id="StreetOfficeShopNumber" type="checkbox" value="非住宅数" name="chk_list" checked="checked" /><label>非住宅数</label></td>
                        <td><input id="ShopNumAT" type="checkbox" value="非住宅任务数" name="chk_list" checked="checked" /><label>非住宅任务数</label></td>
                        <td><input id="SNBfb" type="checkbox" value="非住宅完成比(%)" name="chk_list" checked="checked" /><label>非住宅完成比(%)</label></td>
                    </tr>
                    <tr>
                        
                        <td><input id="ANumber" type="checkbox" value="受理数" name="chk_list" checked="checked" /><label>受理数</label></td>
                        <td><input id="ANumberAT" type="checkbox" value="受理任务数" name="chk_list" checked="checked" /><label>受理任务数</label></td>
                        <td><input id="ANumberBfb" type="checkbox" value="受理完成比(%)" name="chk_list" checked="checked" /><label>受理完成比(%)</label></td>
                    </tr>
                    <tr>
                        
                        <td><input id="xiaoji" type="checkbox" value="已纳税额" name="chk_list" checked="checked" /><label>已纳税额</label></td>
                        <td><input id="AtRevenuePlan" type="checkbox" value="纳税任务数" name="chk_list" checked="checked" /><label>纳税任务数</label></td>
                        <td><input id="AtRevenuePlanBfb" type="checkbox" value="纳税完成比(%)" name="chk_list" checked="checked" /><label>纳税完成比(%)</label></td>
                    </tr>                     
                </table>
                <div class="box-footer">
                    <button type="submit" id="btnExportSure" class="layui-btn layui-btn-springgreen layui-btn-small pull-right" style=" margin-right:30px;">
                        <i class="fa fa-repeat"></i>导出
                    </button>
                    <input type="hidden" id="GIS_AnnualTaskMeg" name="GIS_AnnualTaskMeg" value="" />
                    <input type="hidden" id="where" name="where" value="" />
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script> 


    //页面加载时执行列表展示
    $(document).ready(function () {
        GetGIS_AnnualTaskInfo();
    });

    var html = "";
    var inputStr = "";
    //列表展示
    function GetGIS_AnnualTaskInfo(inputStr) {
    
        getAjax("/ReportForms/GetGIS_AnnualTask", { "where": inputStr }, function (data) {
            accordionJson = eval("(" + data + ")");
            $.each(accordionJson, function (i) {             
                html += "<tr>";
                html += "<td hidden>" + accordionJson[i].Count_Id + "</td>";
                html += "<td>" + accordionJson[i].StreetOffice + "</td>";
                html += "<td>" + accordionJson[i].StreetOfficeHousNumber + "</td>";
                html += "<td>1000</td>";
                html += "<td>" + (accordionJson[i].StreetOfficeHousNumber*0.1).toFixed(2)+"%"+ "</td>";
                html += "<td>" + accordionJson[i].StreetOfficeShopNumber + "</td>";
                html += "<td>1000</td>";
                html += "<td>" + (accordionJson[i].StreetOfficeShopNumber*0.1).toFixed(2)+"%"+ "</td>";
                html += "<td>" + accordionJson[i].ANumber + "</td>";
                html += "<td>1000</td>";
                html += "<td>" + (accordionJson[i].ANumber*0.1).toFixed(2) +"%"+ "</td>";
                html += "<td>" + (accordionJson[i].xiaoji*0.01).toFixed(2) + "</td>";               
                html += "<td>" + (accordionJson[i].AtRevenuePlan*0.01).toFixed(2) + "</td>";
                if (accordionJson[i].AtRevenuePlan == 0) {
                    html += "<td> /</td>";
                }
                else
                {
                    html += "<td>" + ((accordionJson[i].xiaoji / accordionJson[i].AtRevenuePlan)*100).toFixed(2) + "%"+"</td>";
                }              
                html += "</tr>";            
            });
            $("#accordion").empty().append(html);
        })
    }
    //查询
    $(function () {
        $("#btnSearch").click(function () {
            var inputStr = $("#inputStr").val().trim();  //获取搜索条件    
            //隐藏域 导出条件赋值
            document.getElementById("where").value = inputStr;
            html = "";
            GetGIS_AnnualTaskInfo(inputStr);
        })
    });

    /*导出*/
    $("#btnExport").click(function () {
        layer.open({
            type: 1,
            title: '导出提示',
            shade: false,
            skin: 'layui-layer-rim',
            area: ['620px', '320px'], //宽高
            content: $('#exportHtml')
        });
    });
    /*导出交互*/
    $("#btnExportSure").click(function () {
        var arr = new Array();
        $("[name='chk_list']").each(function () {
            if ($(this).is(":checked")) {
                arr.push($(this).attr("id") + "|" + $(this).val());
            }
        });
        $("#GIS_AnnualTaskMeg").val(arr);
        document.getElementById('formDownload').submit();
        layer.closeAll();
    });
</script>